﻿using System;
using System.Collections.Generic;

namespace Gumini.JulaDB.Data
{
    /// <summary>
    /// A schema information for a database table.
    /// </summary>
    [Serializable]
    public class TableDefinition
    {
        internal TableDefinition(string name, IEnumerable<TableColumn> columns)
        {
            this.Name = name;
            this.Heading = new TableHeading<TableColumn>(columns);
            this.Heading.CheckNamesUnique();
        }

        /// <summary>
        /// The name of the table.
        /// </summary>
        public string Name { get; private set; }

        /// <summary>
        /// Definitions of the columns in the table.
        /// </summary>
        public TableHeading<TableColumn> Heading { get; private set; }
    }
}
